package com.kfgj.hkp.common.enums;


import com.kfgj.hkp.common.exception.ExceptionEvent;

/**
 * Created by liwensihan on 2015-11-13.
 *
 * @author liwensihan
 */
public enum ResponseMessage implements ExceptionEvent {

    /**
     * 通用提示
     */
    CommonError("CE1001","%s"),

    ParameterIsNull("P1001","参数%s不能为空"),

    /**
     * 用户相关
     */
    UserNotLogin("U1000","用户未登录"),


    CustomerNotExists("U1001","用户%s不存在"),
    CustomerPasswordError("U1002","用户密码错误"),
    UserNameOrPasswordIsNull("U1003","用户名或密码为空"),
    PhoneNumberExists("U1005","手机号已经注册"),
    VerifyCodeError("U1004","验证码错误"),
    EmployeeNotExists("E1001","账号%s不存在"),
    EmployeeHasExists("E1002","账号%s已存在"),

    UserPhoneErr("U1006", "手机号格式错误")
    ;

    private String code;
    private String message;
    private String[] args;


    ResponseMessage(String code, String message){
        this.code = code;
        this.message = message;
    }

    ResponseMessage(){}

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {

        return this.message;
    }

    @Override
    public String[] getArgs() {
        return this.args;
    }

    public ResponseMessage setArgs(String... args){
        this.args = args;
        return this;
    }

    public ResponseMessage setMessage(String message) {
        this.message = message;
        return this;
    }

    public ResponseMessage setCode(String code) {
        this.code = code;
        return this;
    }
}
